﻿@using HiLand.Utility.Entity
@model LogicStatusInfo
@{
    ViewBag.Title = "ChangePassword";

    bool isDisplayTip = false;
    string tipStatus = "success";
    string tipMessage = string.Empty;
    if (Model != null)
    {
        isDisplayTip = true;
        if (Model.IsSuccessful == true)
        {
            tipStatus = "success";
            tipMessage = "Change password successfully.";
        }
        else
        {
            tipStatus = "error";
            tipMessage = "There is a error in changing passwod.";
        }
    }

    Guid userGuid = Guid.Empty;
    HiLand.Framework.BusinessCore.BusinessUser currentUser = this.ViewBag.CurrentUser;
    if (currentUser != null)
    {
        userGuid = currentUser.UserGuid;
    }
}
<h2>
    ChangePassword
</h2>
@if (isDisplayTip == true)
{
    <div class="notification @tipStatus png_bg">
        <a href="#" class="close">
            <img src="@Url.Content("~/Content/NotificationImages/cross_grey_small.png")" title="Close this notification"
            alt="close" /></a>
        <div>
            @tipMessage
        </div>
    </div>
}
@using (Html.BeginForm())
{
    <table>
        <tr>
            <td style="width:150px;">
                Original Password:
            </td>
            <td>@Html.TextBox("passwordOld")
            </td>
        </tr>
        <tr>
            <td>
                New Password:
            </td>
            <td>@Html.TextBox("passwordNew")
            </td>
        </tr>
        <tr>
            <td>
                Confirm New Password:
            </td>
            <td>@Html.TextBox("passwordNewConfirm")
            </td>
        </tr>
    </table>
    @Html.Hidden("userGuid", userGuid)
    <input class="button" type="submit" value="Submit" />
}
<script type="text/javascript">
    $(document).ready(function () {
        $("#aSettingSection").addClass("current");
        $("#aChangePassword").addClass("current");
    });
</script>
